<template>
  <div>
    <div id="BarChart" style="width: 500px; height: 200px">基础柱状图</div>
  </div>
</template>

<script>
// import * as echarts from "echarts";

export default {
  data() {
    return {};
  },
  mounted() {
    // 基于准备好的dom，初始化echarts实例
    var BarChart = echarts.init(document.getElementById("BarChart"));
    // 绘制图表
    var BarChartOptions = {
      title: {
        text: "基础柱状图",
      },
      tooltip: {},
      xAxis: {
        data: ["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"],
      },
      yAxis: {},
      series: [
        //设置主图表的信息数据
        {
          name: "销量",
          type: "bar",
          data: [5, 20, 36, 10, 10, 20],
        },
      ],
    };
    BarChart.setOption(BarChartOptions);
    //===============================================================================================
  },
};
</script>
<style lang='less' scoped>
</style>